/**
 * 
 */
package com.woniu.config;

import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import com.woniu.interceptor.MyInterceptor;

/**
 * @author willyuan
 *
 */
//@Configuration
public class InterceptorConfig extends WebMvcConfigurerAdapter {

	@Bean
	public MyInterceptor myInterceptor() {
		return new MyInterceptor();
	}

	@Bean
	public RestTemplate restTemplate() {
		return new RestTemplate();

	}

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(myInterceptor()).addPathPatterns("/**").excludePathPatterns("/", "/forget", "/success",
				"/info", "/**/**/**/*login*", "/**/**/**/forget", "/**/*error*/**","/**/**/*defaultKaptcha*", "/**/**/*getMsg*");

		super.addInterceptors(registry);
	}

}
